<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Libs\ConfModel;

final class LogsConf extends ConfAbstract
{
    public const PREFIX                         = 'LOG.';               // 配置前缀[必定点结尾]
    protected int $level                        = 0;                    // 日志[0-none,1-fatal,2-error,3-exception,4=warn,5-info,6-debug,7-trace]
    protected int $cacheSize                    = 0;                    // 日志缓存大小[0-立即写入日志]
    protected int $cacheTime                    = 10;                   // 日志缓存时长[秒][0-每个间歇写入日志]
    protected string $fatalFile                 = '';                   // FATAL Write File
    protected string $errorFile                 = '';                   // ERROR Write File
    protected string $exceptionFile             = '';                   // EXCEPTION Write File
    protected string $warnFile                  = '';                   // WARN Write File
    protected string $infoFile                  = '';                   // INFO Write File
    protected string $debugFile                 = '';                   // DEBUG Write File
    protected string $traceFile                 = '';                   // TRACE Write File

    /**
     * @param array $confData
     */
    public function __construct(array $confData)
    {
        $this->init($confData);
    }

    /**
     * @return int
     */
    public function getLevel(): int
    {
        return $this->level;
    }

    /**
     * @return int
     */
    public function getCacheSize(): int
    {
        return $this->cacheSize;
    }

    /**
     * @return int
     */
    public function getCacheTime(): int
    {
        return $this->cacheTime;
    }

    /**
     * @return string
     */
    public function getFatalFile(): string
    {
        return $this->fatalFile;
    }

    /**
     * @return string
     */
    public function getErrorFile(): string
    {
        return $this->errorFile;
    }

    /**
     * @return string
     */
    public function getExceptionFile(): string
    {
        return $this->exceptionFile;
    }

    /**
     * @return string
     */
    public function getWarnFile(): string
    {
        return $this->warnFile;
    }

    /**
     * @return string
     */
    public function getInfoFile(): string
    {
        return $this->infoFile;
    }

    /**
     * @return string
     */
    public function getDebugFile(): string
    {
        return $this->debugFile;
    }

    /**
     * @return string
     */
    public function getTraceFile(): string
    {
        return $this->traceFile;
    }
}